package com.ma.gulimall.product.fallback;

import com.ma.gulimall.exception.BizCodeEnume;
import com.ma.gulimall.product.feign.SeckillFeignService;
import com.ma.gulimall.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @ClassName SeckillFeignServiceFallBack
 * @Author: mayongqiang
 * @DATE 2021/11/24 22:11
 * @Description: 远程调用秒杀服务错误回调
 */
@Component
@Slf4j
public class SeckillFeignServiceFallBack implements SeckillFeignService {
    @Override
    public R getSkuSeckillInfo(Long skuId) {
        log.info("熔断方法调用.....Seckill服务宕机....");
        return R.error(BizCodeEnume.TO_MANY_REQUEST.getCode(), BizCodeEnume.TO_MANY_REQUEST.getMsg());
    }
}
